<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
		<link href="css/ydui.css" rel="stylesheet" type="text/css">
		<link href="css/index.css" rel="stylesheet" type="text/css">
		
		<title>活动登记</title>
		<style>
			.list li h3{background:#FFD76E;color:#A51208;}
			.list li{border:0}
			.list h4 span{width:calc(100% / 3)}
			.list h4 span:nth-child(even){border-right:1px #F38515 solid;color:#A51208 }
			.list h4 .dj{color:#F92F30}
		</style>
	</head>

	<body>
		<section class="g-flexview">
			<header class="m-navbar">
				<div class="navbar-center" style="margin-left:5%">
					<img src="img/logo.png">
				</div>
				<a href="#" class="navbar-item" style="position: absolute;right:10px">
					<img src="img/icon_layout_top_grzx.png" style="height:0.4rem;margin-right:5px">
					<span class="name">请登录</span>
				</a>
			</header>
			<div class="g-scrollview list" style="background:url(img/bg.jpg) no-repeat;background-size:100% 100%">
				
			</div>
	
		</section>
		<script src="http://g.alicdn.com/dingding/open-develop/1.9.0/dingtalk.js"></script>
		<script src="js/jquery-1.11.1.js"></script>
		<script src="js/ydui.flexible.js"></script>
		<script src="js/ydui.js"></script>
		<script>
			$(function() {
				YDUI.dialog.loading.open('很快加载好了');
				var deptId=''
				$.post("selectUserByDdid", function(data) {	
				
					if(data.data.name != undefined) {
						var name = data.data.name;
						
						deptId = data.data.deptId
						$(".name").text(name)
					}
				})
				$.post("selectActivity", function(data) {
					/*YDUI.dialog.alert(JSON.stringify(data))*/
					if(data.code== 0) {
						var rel=data.data
						var html = '';
						for(var i in rel) {
							if(rel[i].活动代码=='13'||rel[i].活动代码=='15'){
								html += '<li><h3>' + rel[i].活动名称 + '</h3>';
								html += '<h4><span class="cx" code="' + rel[i].活动代码 + '"  url="cx" style="width:50%">登记记录</span>';
								/*html+='<span class="yxkh" code="' + rel[i].活动代码 + '" url="wdkh">营销客户</span>';*/
								html += '<span class="dj" code="' + rel[i].活动代码 + '"  url="dd_input" style="width:50%">登记抽奖</span></h4></li>';
							}else if(rel[i].活动代码=="14"){
								html += '<li><h3>' + rel[i].活动名称 + '</h3>';
								html += '<h4><span class="cx" code="' + rel[i].活动代码 + '"  url="cx">查询</span>';
								html+='<span class="yxkh" code="' + rel[i].活动代码 + '" url="wdkh">营销客户</span>';
								html += '<span class="dj" code="' + rel[i].活动代码 + '"  url="dd_hbxx" >登记</span></h4></li>';
							}else if(rel[i].活动代码=='16'){
								html += '<li><h3>' + rel[i].活动名称 + '</h3>';
								html += '<h4><span class="cx" code="' + rel[i].活动代码 + '"  url="cx" style="width:50%">查询</span>';								
								html += '<span class="dj" code="' + rel[i].活动代码 + '"  url="input2?id_prikey=0" style="width:50%">登记</span></h4></li>';
							}else if(rel[i].活动代码=='17'){
									html += '<li><h3>' + rel[i].活动名称 + '</h3>';
									html += '<h4><span class="cx" code="' + rel[i].活动代码 + '"  url="cx" style="width:50%">查询</span>';
									html += '<span class="dj" code="' + rel[i].活动代码 + '"  url="input3" style="width:50%">登记</span></h4></li>';
							}
						}
						
						html+='<li><h3>客户扫码登记个人信息</h3><h4><span class="ewm"  url="ewm" style="width:100%">查看二维码</span></h4></li>'
						html += '<li><h3>活动统计分析</h3><h4><span class="tjfx" style="width:100%" url="tjfx">查看</span></h4></li>'
						html += '<li><h3>奖品库存管理</h3><h4><span  style="width:100%" url="kcgl">查看</span></h4></li>'
						$(".list").html(html)
						YDUI.dialog.loading.close();
						$(".list span").click(function() {
							var code = $(this).attr("code")
							var name = $(this).parent("h4").siblings("h3").text()
							sessionStorage.setItem("name", name)
							sessionStorage.setItem("code", code)
							var url=$(this).attr("url")
							window.location.href =url
						})	
					}
				})
				
			})
		</script>
	</body>

</html>